package com.twu.biblioteca;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.ListIterator;

/**
 * User: akerber
 * Date: 1/23/13
 * Time: 6:33 PM
 */
public class DisplayMessage {

    public void showWelcomeMessage() {
        System.out.println("Welcome to Biblioteca");
    }

    public void showInvalidSelectedOptionMessage() {
        System.out.println("Select a valid option!!");
    }

    public void showUserInformationMessage() {
        System.out.println("Please talk to a Librarian. Thank you.");
    }

    public void showSuccessfullyReservedBookMessage() {
        System.out.println("Thank You! Enjoy the book.");
    }

    public void showBookNotAvailableMessage() {
        System.out.println("Sorry we don't have that book yet.");
    }


    public void showMovieInformation(Movie movie) {
        String movieDetails = movie.retrieveFormattedMovieDetails();
        System.out.println(movieDetails);

    }

    public void showLoggedUserInformationMessage() {
        //To change body of created methods use File | Settings | File Templates.
    }

    public void showMainMenuAvailableOptionsWhenLoggedIn(ArrayList<MainMenu.OPTIONS> availableOptions){
        ListIterator<MainMenu.OPTIONS> iterator=null;
        for(iterator = availableOptions.listIterator();iterator.hasNext();)
        {
            System.out.println(iterator.nextIndex() + " " + iterator.next().name());
        }

    }

    public void showMainMenuAvailableOptionsWhenNotLoggedIn(ArrayList<MainMenu.OPTIONS> availableOptions){
        ListIterator<MainMenu.OPTIONS> iterator=null;
        MainMenu.OPTIONS option;
        for(iterator = availableOptions.listIterator();iterator.hasNext();)
        {
            option = iterator.next();
            System.out.println((iterator.nextIndex() - 1) + " " + option.getMenuMessage());
        }

    }

    public void showSelectAnOptionMessage() {
        System.out.println("Select an option:");
    }

    public void showInformUserName() {
        System.out.println("Username: ");
    }

    public void showInformPassword() {
        System.out.println("Password: ");
    }

    public void showLoginError() {
        System.out.println("Invalid login");
    }
}
